using System.Collections.Generic;
using System.Linq;

namespace SiteLib.Data
{
    public partial class SiteContentType
    {
        public static SiteContentType GetSiteContentTypeByCode(int siteContentTypeCode)
        {
            return Search(siteContentTypeCode).FirstOrDefault();
        }

        public static List<SiteContentType> GetAllContentTypes()
        {
            return Search();
        }

        public void Save()
        {
            IsDeleted = false;
            IsShortList = false;

            Insert();
        }

        public void MarkAsDeleted()
        {
            IsDeleted = true;

            Update();
        }

        public void SetShortListProperty(bool isShortList)
        {
            IsShortList = isShortList;

            Update();
        }
    }
}

